<?php $this->_extends('_layouts/bocib_layout'); ?>

<?php $this->_block('content');?>
<div id="content">
    <h2>添加文章</h2>
    <p class="jump"><a href="<?=url('bonewsnotice/listnews');?>">查看所有新闻 >></a></p>
    <form action="<?=url('bonewsnotice/addnews');?>" method="post" enctype="multipart/form-data">
        <div>
            <label for="title">文章标题:</label>
            <input type="text" name="title" id="title" value="" size="75px" /><br />

            <label for="ctgry_id">选择分类: </label>
            <select name="ctgry_id" id="ctgry_id">
                <option value="11" selected="selected">默认为"本院新闻"</option>
                <?php foreach(NewsCategory::find('haschild != 1')->all()->query() as $ctgry) { ?>
                <option value="<?=$ctgry->id;?>"><?=$ctgry->category;?></option>
                <?php } ?>
            </select><br />

            <label>文章发布:</label>
            <input type="text" name="publisher" value="上外管院" size="20" /><label><span class="stips"> (默认为"上外管院")</span></label><br />

            <label for="sticky">是否置顶:</label>
            <label>是</label>
            <input type="radio" name="sticky" value="1">
            <label>否</label>
            <input type="radio" name="sticky" value="0" checked="checked"><br />

            <label for="isprivate">外部可视:</label>
            <label>是</label>
            <input type="radio" name="isprivate" value="0" checked="checked">
            <label>否</label>
            <input type="radio" name="isprivate" value="1"><label><span class="stips pdl20">(选择"是"表示无需登录即可查看该新闻)</span></label><br />

            <label>发布时间:</label>
            <label>20</label>
            <select name="ayear">
                <option value="04">04</option>
                <option value="05">05</option>
                <option value="06">06</option>
                <option value="07">07</option>
                <option value="08">08</option>
                <option value="09" selected="selected">09</option>
                <?php for($baseyear=10;$baseyear<20;++$baseyear) { ?>
                <option value="<?=$baseyear;?>"><?=$baseyear;?></option>
                <?php } ?>
            </select><label>年</label>
            <select name="amonth">
                <option value="01">01</option>
                <option value="02">02</option>
                <option value="03">03</option>
                <option value="04">04</option>
                <option value="05">05</option>
                <option value="06">06</option>
                <option value="07">07</option>
                <option value="08">08</option>
                <option value="09">09</option>
                <option value="10">10</option>
                <option value="11">11</option>
                <option value="12">12</option>
            </select><label>月</label>
            <select name="aday">
                <option value="01">01</option>
                <option value="02">02</option>
                <option value="03">03</option>
                <option value="04">04</option>
                <option value="05">05</option>
                <option value="06">06</option>
                <option value="07">07</option>
                <option value="08">08</option>
                <option value="09">09</option>
                <?php for($baseday=10;$baseday<32;++$baseday) { ?>
                <option value="<?=$baseday;?>"><?=$baseday;?></option>
                <?php } ?>
            </select><label>日</label><br />
            <label><span class="tips">如果未选择日期，即日期为"2009-01-01"，系统将使用当前日期作为新闻发布时间</span></label><br />

            <label for="tag">新闻标签:</label>
            <input type="text" value="" name="tag" id="tag" /><label><span class="stips pdl20">(可选)搜索关键字，多个标签请用","(英语逗号)隔开</span></label><br />
            <label>已有标签：
			<ul>
				<li><b>标签：</b></li>
				<li>新闻通知标签：
				<?php foreach(Tag::find('category = ?', '新闻通知')->all()->query() as $tag) { ?>
					<a href="#"><?=$tag->tag;?></a>
				<?php } ?>
				</li> 
				<li>国际交流标签：
				<?php foreach(Tag::find('category = ?', '国际交流')->all()->query() as $tag) { ?>
					<a href="#"><?=$tag->tag;?></a>
				<?php } ?>
				</li> 
				<li>创新实践标签：
				<?php foreach(Tag::find('category = ?', '创新实践')->all()->query() as $tag) { ?>
					<a href="#"><?=$tag->tag;?></a>
				<?php } ?>
				</li> 
			</ul>
            </label><br />

            <label>内容:<span class="highlight">请注意:新闻插图文件请勿使用中文文件名，否则将无法上传</span>,上传插图请点击<img src="misc/fck_upload_icon.png" alt="" />（第四排第一个图标），选择"上传"</label><br />

			<?php $this->_control('fckeditor', 'body' , array('base_dir' => '/misc/fckeditor')); ?>

            <label>附件:<span class="stips">(可选)jpg,png,gif, doc,docx,ppt,pptx,xls,xlsx, txt,pdf, rar,zip,tgz, mp3, 最大尺寸 8M</span></label><br />
            <input type="file" name="attachment[]" value="浏览" /><br />
            <input type="file" name="attachment[]" value="浏览" /><br />
            <input type="file" name="attachment[]" value="浏览" /><br />
            <input type="file" name="attachment[]" value="浏览" /><br />
            <input type="file" name="attachment[]" value="浏览" /><br />
            <input type="submit" value="提交" />
        </div>
    </form>
</div>
<?php $this->_endblock('content');?>